package com.xqboss.apps.domain.member;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xqboss.apps.domain.BaseTable;
import com.xqboss.apps.domain.nft.NftNumber;
import com.xqboss.apps.enums.nft.NftTypeEnum;
import com.xqboss.apps.enums.nft.UserNftStatusEnum;
import com.xqboss.apps.enums.user.UserNftSourceTypeEnum;
import com.xqboss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;

import javax.persistence.Id;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 用户NFT表
 * </p>
 *
 * @author lang.liu
 * @since 2022-6-2
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
//@Document(indexName = "sysMemberNft")
@ApiModel(value = "SysUserNft对象", description = "用户NFT表")
public class SysUserNft extends BaseTable {

    private static final long serialVersionUID = 1L;

    @Id
    @TableId(value = "id")
    private Long id;

    @ApiModelProperty(value = "NFT编号ID")
    private Long nftNumberId;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "nft作品ID")
    private Long nftId;

    @ApiModelProperty(value = "nft类型")
    private NftTypeEnum nftType;

    @ApiModelProperty(value = "持有状态")
    private UserNftStatusEnum nftStatus;

    @ApiModelProperty(value = "关联的订单号主表id,如果是赠送则关联上一个用户的此关联表id")
    private Long orderMainId;

    @ApiModelProperty(value = "订单子表ID")
    private Long orderItemId;

    @ApiModelProperty(value = "藏品来源")
    private UserNftSourceTypeEnum source;

    @ApiModelProperty(value = "可售时间")
    private LocalDateTime saleableTime;

    @ApiModelProperty(value = "是否锁定")
    private Integer isLock;


    // 缓存分发的藏品编号
    @TableField(exist = false)
    private NftNumber nftNumber;
}
